<?php

namespace app\Modules\Api\models;

use Yii;
use app\models\BidRcd as BaseModel;

/**
 * LoginForm is the model behind the login form.
 *
 * @property user|null $user This property is read-only.
 *
 */
class BidRcd extends BaseModel
{
    public function fields()
    {
        $fields = parent::fields();
        $strvalfields = [
            'bidrcdid',
            'product_id',
            'auction_id',
            'user_id',
            'state',
            'price',
        ];

        foreach($strvalfields as $strvalfield){
            $fields[$strvalfield] = function() use ($strvalfield){
                return strval($this->$strvalfield);
            };
        }
        $fields['img'] = function(){
            return \Yii::$app->params['uploadUrl'].$this->img;
        };
        unset($fields['created_at'],$fields['updated_at']);
        return $fields;
    }

}